import { Outlet } from "react-router-dom"

// 列表转树形结构
export function listToTree(list,id){
    let arr = []
    list.forEach((item)=>{
        // 找一级部门
        if(item.pid == id){
            let node = {
                title: item.name,
                key: item.id,
                managerName: item.managerName,
                pid: item.pid,
                id: item.id,
                code: item.code,
                managerId: item.managerId,
                introduce: item.introduce
            }
            arr.push(node)
            // 找二级部门
            node.children = listToTree(list, item.id)
        }
    })
    return arr
}